import json


def ReadJson(JsonFile):
    """ 读 json 文件

    Args:
        JsonFile (_type_): _description_

    Returns:
        _type_: _description_
    """    
    with open(JsonFile, 'r') as f1:
        content = json.load(f1)
        return content


def WriteJson(JsonFile, Content):
    """ 写 json 文件

    Args:
        JsonFile (_type_): _description_
        Content (_type_): _description_
    """
    with open(JsonFile, 'w') as f1:
        json.dump(Content, f1)


a = 100
b = 12
c = 23

with open("test.json", 'w', encoding='GBK') as f1:
    str1 = {'a': str(a), 'b': str(b), 'c': str(c)}
    f1.writelines(json.dumps(str1)+'\n')

JsonPara = ReadJson('test.json')
print(JsonPara)

a1 = JsonPara['a']

b1 = JsonPara['b']
c1 = JsonPara['c']
print(a, b, c)

a_dict = {"key": "value"}
globals().update(a_dict)
print(key)

